package com.controller;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.TimeZone;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexContrller {

	@RequestMapping({ "/","/index"})
	public String toIndex() {
		return "/index";
	}


	@RequestMapping({"{path}/","{path}"})
	public String toIndex(@PathVariable String path) {
		return path + "/index";
	}
	
	@RequestMapping(value = "/index1")
	@ResponseBody
	public String toIndex1() {
		TimeZone.setDefault(null);
		System.clearProperty("user.timezone");
		LocalDateTime now = LocalDateTime.now();
		String format = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
		return format;
	}
}
